import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)
//路由表
const routes = [
{
  path:'/login',
  name:'login',
  component:()=>import('@/views/login')
},
{
  path:'/',
  component:()=>import('@/views/layout'),
  //子路由
  children:[
  {
    path:'/home',
    name:'home',
    component:()=>import('@/views/home')
  },
  {
    path:'/fenglei',
    name:'fenglei',
    component:()=>import('@/views/fenglei')
  },
  {
    path:'/shop',
    name:'shop',
    component:()=>import('@/views/shop')
  },
  {
    path:'/my',
    name:'my',
    component:()=>import('@/views/my')
  },
]
}

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
